home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / xboard21.lha / xboard-2.1.pl11 / xboard.h < prev    next >
C/C++ Source or Header  |  1993-06-14  |  6KB  |  143 lines

  1. /*
  2.  * XBoard -- an Xt/Athena user interface for GNU Chess
  3.  *
  4.  * Original authors:  Dan Sears and Chris Sears
  5.  * Enhancements (Version 2.0):  Tim Mann
  6.  *
  7.  * XBoard borrows its colors, icon and piece bitmaps from XChess
  8.  * which was written and is copyrighted by Wayne Christopher.
  9.  *
  10.  * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts.
  11.  * Enhancements Copyright 1992 Free Software Foundation, Inc.
  12.  *
  13.  * The following terms apply to Digital Equipment Corporation's copyright
  14.  * interest in XBoard:
  15.  * ------------------------------------------------------------------------
  16.  * All Rights Reserved
  17.  *
  18.  * Permission to use, copy, modify, and distribute this software and its
  19.  * documentation for any purpose and without fee is hereby granted,
  20.  * provided that the above copyright notice appear in all copies and that
  21.  * both that copyright notice and this permission notice appear in
  22.  * supporting documentation, and that the name of Digital not be
  23.  * used in advertising or publicity pertaining to distribution of the
  24.  * software without specific, written prior permission.
  25.  *
  26.  * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  27.  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  28.  * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  29.  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  30.  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  31.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  32.  * SOFTWARE.
  33.  * ------------------------------------------------------------------------
  34.  *
  35.  * The following terms apply to the enhanced version of XBoard distributed
  36.  * by the Free Software Foundation:
  37.  * ------------------------------------------------------------------------
  38.  * This file is part of XBOARD.
  39.  *
  40.  * XBOARD is distributed in the hope that it will be useful, but WITHOUT ANY
  41.  * WARRANTY.  No author or distributor accepts responsibility to anyone for
  42.  * the consequences of using it or for whether it serves any particular
  43.  * purpose or works at all, unless he says so in writing.  Refer to the XBOARD
  44.  * General Public License for full details.
  45.  *
  46.  * Everyone is granted permission to copy, modify and redistribute XBOARD, but
  47.  * only under the conditions described in the XBOARD General Public License. A
  48.  * copy of this license is supposed to have been given to you along with
  49.  * XBOARD so you can know your rights and responsibilities.  It should be in a
  50.  * file named COPYING.  Among other things, the copyright notice and this
  51.  * notice must be preserved on all copies.
  52.  * ------------------------------------------------------------------------
  53.  */
  54. #define BOARD_SIZE        8
  55. #define LARGE_SQUARE_SIZE    80
  56. #define MEDIUM_SQUARE_SIZE    64
  57. #define SMALL_SQUARE_SIZE       40
  58. #define LINE_GAP        3
  59. #define MAX_MOVES        512
  60. #define MSG_SIZ            256
  61. #define DIALOG_SIZE        256
  62. #define MOVE_LEN        32
  63. #define TIME_CONTROL        "5"    /* in minutes */
  64. #define TIME_DELAY        "1.0"    /* seconds between moves */
  65. #define MOVES_PER_SESSION    40    /* moves per TIME_CONTROL */
  66. #define WhiteOnMove(move)    (((move) % 2) == 0)
  67. #define ICS_HOST                "valkyries.andrew.cmu.edu"
  68. #define ICS_PORT            5000
  69. #define FIRST_CHESS_PROGRAM    "gnuchessx"
  70. #define SECOND_CHESS_PROGRAM    "gnuchessx"
  71. #define FIRST_HOST        "localhost"
  72. #define SECOND_HOST        "localhost"
  73. #define MATCH_MODE        "False"
  74. #define INIT_STRING        "new\nbeep\nrandom\neasy\n"
  75. #define WHITE_STRING        "white\ngo\n"
  76. #define BLACK_STRING        "black\ngo\n"
  77. #define DEFAULT_SIZE            "Large"
  78. #define WHITE_PIECE_COLOR    "#FFFFCC"
  79. #define BLACK_PIECE_COLOR    "#202020"
  80. #define LIGHT_SQUARE_COLOR    "#C8C365"
  81. #define DARK_SQUARE_COLOR    "#77A26D"
  82. #define MAIN_FONT    "-*-helvetica-medium-o-normal--*-*-*-*-*-*-*-*"
  83. #define COORD_FONT   "-*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*"
  84. #define DEFAULT_FONT "*font: -*-helvetica-medium-r-normal--*-120-*-*-*-*-*-*"
  85. #define BELLCHAR                '\007'
  86. #define NULLCHAR                '\000'
  87. #define BORDER_X_OFFSET         3
  88. #define BORDER_Y_OFFSET         27
  89.  
  90. typedef enum {
  91.     Large, Medium, Small
  92.   } BoardSize;
  93.  
  94. typedef enum {
  95.     BeginningOfGame, MachinePlaysWhite, MachinePlaysBlack, TwoMachinesPlay,
  96.     ForceMoves, PlayFromGameFile, PauseGame, EndOfGame, EditPosition
  97.   } GameMode;
  98.  
  99. typedef enum {
  100.     MatchFalse, MatchInit, MatchPosition, MatchOpening
  101.   } MatchMode;
  102.  
  103. typedef enum {
  104.     IcsIdle, IcsPlayingWhite, IcsPlayingBlack, IcsObserving
  105.   } IcsMode;
  106.  
  107. typedef enum {
  108.     WhitePawn, WhiteRook, WhiteKnight, WhiteBishop, WhiteQueen, WhiteKing,
  109.     BlackPawn, BlackRook, BlackKnight, BlackBishop, BlackQueen, BlackKing,
  110.     EmptySquare,
  111.     ClearBoard, WhitePlay, BlackPlay /*for use on EditPosition menus*/
  112.   } ChessSquare;
  113.  
  114. typedef ChessSquare Board[BOARD_SIZE][BOARD_SIZE];
  115.  
  116. typedef enum {
  117.     WhiteKingSideCastle = 1, WhiteQueenSideCastle,
  118.     WhiteKingSideCastleWild, WhiteQueenSideCastleWild,
  119.     WhitePromotionKnight, WhitePromotionBishop,
  120.     WhitePromotionRook, WhitePromotionQueen,
  121.     BlackPromotionKnight, BlackPromotionBishop,
  122.     BlackPromotionRook, BlackPromotionQueen,
  123.     BlackKingSideCastle, BlackQueenSideCastle,
  124.     BlackKingSideCastleWild, BlackQueenSideCastleWild,
  125.     WhiteCapturesEnPassant, BlackCapturesEnPassant, NormalMove,
  126.     WhiteWins, BlackWins, GameIsDrawn, StartGame, BadMove, Comment,
  127.     AmbiguousMove, PositionDiagram, ElapsedTime
  128.   } ChessMove;
  129.  
  130. typedef enum {
  131.     ResetTimers, DecrementTimers, SwitchTimers, 
  132.     ReDisplayTimers, StopTimers, StartTimers
  133.   } ClockMode;
  134.  
  135. /*
  136.  * Various compatibility grunge
  137.  */
  138. #ifdef __STDC__
  139. #define    P(args)        args
  140. #else
  141. #define P(args)        ()
  142. #endif
  143.